#include <iostream>
#include<iomanip>
using namespace std;
int main(){
    int n;
    cin>>n;
    if(n>100)return 0;
    for(int i=0;i<n;i++){
        int a;
        double sum=0,m;
        cin>>a;
        for(int j=1;j<=a;j++){
             m=1.0/j;
            if(j%2!=0){
                sum+=m;
            }else{
                sum-=m;
            }
        }
        cout<<fixed<<setprecision(2)<<sum<<endl;
    }
}